package com.chance.cc.crawler.development.command.trigger.domain.du;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.core.downloader.HttpPage;
import com.chance.cc.crawler.development.command.job.domain.du.DuProductDetailCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.job.domain.du.DuProductFindListCrawlerSchedulerJob;
import com.chance.cc.crawler.development.command.trigger.CommonCrawlerTestSchedulerTrigger;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;

/**
 * @author lt
 * @version 1.0
 * @date 2021-04-26 14:04:41
 * @email okprog@sina.com
 */
public class DuProductCrawlerSchedulerTrigger extends CommonCrawlerTestSchedulerTrigger {

    public static void main(String[] args) {

//        publishDuProductFindListScheduleTriggerInfo(DuProductFindListCrawlerSchedulerJob.crawlerScheduler());
        publishDuProductDetailScheduleTriggerInfo(DuProductDetailCrawlerSchedulerJob.crawlerScheduler());

//        publishDuProductSimpleScheduleTriggerInfo(DuProductFindListCrawlerSchedulerJob.crawlerScheduler());
//        publishDuProductSimpleScheduleTriggerInfo(DuProductDetailCrawlerSchedulerJob.crawlerScheduler());
    }


    public static void publishDuProductFindListScheduleTriggerInfo(CrawlerJob crawlerJob){

        HttpPage page = metaServiceCommand_15.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                DuProductFindListCrawlerSchedulerJob.domainId,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 0 13 * * ?",
                "得物商品新品列表每天13:00采集一次");
    }
    public static void publishDuProductDetailScheduleTriggerInfo(CrawlerJob crawlerJob){

        HttpPage page = metaServiceCommand_15.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                DuProductFindListCrawlerSchedulerJob.domainId,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "0 10 0 * * ?",
                "得物全量商品详情每天00:10采集一次");
    }

    public static void publishDuProductSimpleScheduleTriggerInfo(CrawlerJob crawlerJob){

        HttpPage page = metaServiceCommand_15.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                DuProductFindListCrawlerSchedulerJob.domainId,
                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "",
                "得物商品信息临时采集");
    }
}
